package com.jxj.service;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jxj.daoImpl.UserDaoImpl;
import com.jxj.entity.User;
@Service
@Transactional
public class UserServiceImpl {
	@Autowired
	private UserDaoImpl impl;	
	//注册
	public void saveuser(User user){
	
		impl.register(user);
	}	
	//查重
	public boolean findUser(String xuehao){
		if (impl.findUser(xuehao)) {
			return true;
		}
		else {
			return false;
		}		
	}
	//用户登录
	public boolean loginuser(String xuehao,String password){
		if(impl.login(xuehao, password)){
			return true;
		}
		else {
			return false;
		}
		
	}
	public boolean loginAdmin(String xuehao,String password){
		if(impl.loginAdmin(xuehao, password)){
			return true;
		}
		else {
			return false;
		}
		}
		
	public User findUser1(String xuehao){
			User user=impl.findUser1(xuehao);
			return user;	
	}
	public void updateUser(String name,int telephone,String email,User user,String school){
		impl.updateUser(name,telephone,email,user,school);
	}
	public void updateMoney(double money,String xuehao){
		impl.updateMoney(money,xuehao);
		
	}
}
